﻿using NetWing.BPM.Core;
using NetWing.Common.Data.SqlServer;
using NetWing.Common;
using NetWing.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NetWing.BPM.Admin.JydWodrmb
{
    public partial class datalc1 : System.Web.UI.Page
    {


        protected string OrderID;
        protected string comname;
        protected string connman;
        protected string tel;
        protected string adddate;
        protected string deliveryDate;
        protected string jjy;
        protected string ywy;
        protected string explain;
        protected string huofa;
        protected string ys;
        protected string jedx;
        protected string jexx;
        protected string yufuk;
        protected string yufukuana;
        protected string order_img;
        protected JydOrderModel model;

        public DataTable dt = null;
        public DataTable dte = null;
        protected string b64 = "";
        string okeyid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            string pid = Request["KeyId"];
            okeyid = Request["okeyid"].Substring(0,Request["okeyid"].Length-1);
            //传入两个参数action=qrcode&mainkeyid=
            b64 = QRCode.GenerateBase64(@"JydModleOrder\img\jyd.png", ConfigHelper.GetValue("website") + "/JydModleOrder/taskQRcode.aspx?KeyID=" + pid);
            Response.Write(b64);



            string dateii = Request["OrderID"];
            string sql = null;
            //string[] o = okeyid.Split(',');
            //foreach (string i in o)
            //{
                sql = "select * from jydOrderDetail where  orderid='" + dateii + "' and keyid in(" + Request["okeyid"].Substring(0,Request["okeyid"].Length-1) + ")";
                dt = SqlEasy.ExecuteDataTable(sql);
            string sqle = "select * from jydOrder where OrderID='" + dateii + "' and KeyId=" + pid;
            dte = SqlEasy.ExecuteDataTable(sqle);
            //string shname = "";
            //foreach (DataRow dr in dte.Rows)
            //{
            //    shname += dr["OrderID"].ToString() + ",";
            //}
            //shname = shname.Substring(0, shname.Length - 1);

            model = new JydOrderModel();
            if (dte.Rows.Count > 0)
            {
                model.OrderID = dte.Rows[0]["OrderID"].ToString();
                model.comname = dte.Rows[0]["comname"].ToString();
                model.connman = dte.Rows[0]["connman"].ToString();
                model.tel = dte.Rows[0]["tel"].ToString();
                adddate = dte.Rows[0]["adddate"].ToString();
                deliveryDate = dte.Rows[0]["deliveryDate"].ToString();
                model.jjy = dte.Rows[0]["jjy"].ToString();
                model.ywy = dte.Rows[0]["ywy"].ToString();
                model.explain = dte.Rows[0]["explain"].ToString();
                model.huofa = dte.Rows[0]["huofa"].ToString();
                model.ys = dte.Rows[0]["ys"].ToString();
                model.jedx = dte.Rows[0]["jedx"].ToString();
                jexx = dte.Rows[0]["jexx"].ToString();
                yufuk = dte.Rows[0]["yufuk"].ToString();


                model.yufukuana = dte.Rows[0]["yufukuana"].ToString();
                order_img = dte.Rows[0]["order_img"].ToString();

                OrderID = model.OrderID;
                comname = model.comname;
                connman = model.connman;
                tel = model.tel;
                jjy = model.jjy;
                ywy = model.ywy;
                explain = model.explain;
                huofa = model.huofa;
                ys = model.ys;
                jedx = model.jedx;
                jedx = model.jedx;
                yufukuana = model.yufukuana;

            }
            else
            {

            }


        }



    }
}

